package com.itheima.Jiuye11;

import java.io.File;

public class Test01 {
    public static void main(String[] args) {
        //meth01();

        meth();
    }

    private static void meth01() {
        File file = new File("E:\\ExceptionTest");
        boolean file2 = file.exists();     //exists 判断file对象指向的资源是否存在
        boolean file1 = file.isFile();    //isFile  判断file对象指向的资源是否为文件
        boolean file3 = file.isDirectory();//isDirectory  判断file对象指向的资源是否为文件夹
        System.out.println(file2);
        System.out.println(file1);
        System.out.println(file3);
    }

    private static void meth() {
        File file4 = new File("E:\\新版JAVASE基础");
        File[] files = file4.listFiles();
        if (files != null){
            for (File file5 : files) {
                System.out.println(file5.getName());
            }
        }
    }
}
